package game.zqll.systems;

import com.artemis.Aspect;
import com.artemis.systems.IteratingSystem;
import game.zqll.components.MoveComp;
import game.zqll.components.PosComp;

public class MoveSystem extends IteratingSystem {

    public MoveSystem() {
        super(Aspect.all(MoveComp.class, PosComp.class));
    }
    @Override
    protected void process(int entityId) {
        PosComp posComp = Mappers.pos.get(entityId);
        MoveComp moveComp = Mappers.move.get(entityId);
        posComp.x += moveComp.velocity.x * world.delta;
        posComp.y += moveComp.velocity.y * world.delta;
    }
}
